﻿CREATE TABLE [dbo].[text_BookStatistic] (
    [BookStatisticId] BIGINT           IDENTITY (1, 1) NOT NULL,
    [UserId]          UNIQUEIDENTIFIER NOT NULL,
    [BookTreeId]      BIGINT           NOT NULL,
    [CreateDate]      DATETIME         CONSTRAINT [DF_text_BookStatistic_CreateDate] DEFAULT (getutcdate()) NOT NULL,
    CONSTRAINT [PK_text_Statistic] PRIMARY KEY CLUSTERED ([BookStatisticId] ASC),
    CONSTRAINT [FK_text_BookStatistic_text_BookTree] FOREIGN KEY ([BookTreeId]) REFERENCES [dbo].[text_BookTree] ([BookTreeId]),
    CONSTRAINT [FK_text_BookStatistic_user_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[user_User] ([UserId])
);

